﻿@page "/sdk/objects/page/r/{RecordId}/custom-body"
@using System.Web;
@model WebVella.Erp.Plugins.SDK.Pages.Page.CustomBodyModel
@{
	Layout = "~/Pages/_AppMaster.cshtml";
	ViewData["Title"] = "Page Customized Body";
	var pageIconClass = "fa fa-file";
	if (!String.IsNullOrWhiteSpace(Model.ErpPage.IconClass)){
		pageIconClass = Model.ErpPage.IconClass;
	}
}
<wv-page-header color="#dc3545" area-label="Pages" title="@Model.ErpPage.Label" subtitle="Custom Body"
				icon-class="@pageIconClass" return-url="@Model.ReturnUrl">
	<wv-page-header-actions>
		@if (!String.IsNullOrWhiteSpace(Model.PagePublicUrl))
		{
		<a href='@Model.PagePublicUrl' target="_blank" class='btn btn-white btn-sm'><i class='fas fa-external-link-alt'></i> Visit Page</a>
		}
		<a href='/sdk/objects/page/m/@(Model.ErpPage != null ? Model.ErpPage.Id : Guid.Empty)/manage-custom?returnUrl=@HttpUtility.UrlEncode(Model.CurrentUrl)' class='btn btn-white btn-sm'><i class='fa fa-cog go-orange'></i> Manage Custom Body</a>
	</wv-page-header-actions>

	<wv-page-header-toolbar>
		@foreach (var action in Model.HeaderToolbar)
		{
			@Html.Raw(action)
		}
	</wv-page-header-toolbar>

</wv-page-header>

<wv-form label-mode="Stacked" mode="Display">
	<wv-section class="mt-4">
		<wv-row>
			<wv-column span="12">
				<wv-field-checkbox label-text="Custom Body" value="@Model.IsRazorBody" name="IsRazorBody"
								   text-true="custom body  enabled" text-false="custom body disabled"></wv-field-checkbox>
			</wv-column>
		</wv-row>
		<wv-row>
			<wv-column span="12">
				<wv-field-code label-text="RazorBody" value="@Model.RazorBody" name="RazorBody" height="600px"></wv-field-code>
			</wv-column>
		</wv-row>
	</wv-section>

</wv-form>
